---触发成功, 减少主动技能的CD
---@class BuffEffect430005100:BaseBuffEffect
BuffEffect430005100 = ClientFight.CreateClass("BuffEffect430005100",ClientFight.BaseBuffEffect)
local t = BuffEffect430005100
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local target = buff.target
    local buffEffectValue = buff.buffBean.f_BuffEffectValue

    --达成条件, 触发清空技能CD ,
    local entries = target.cooldowns
    local loop = function (skillId,entry)
        local skillBean = SkillManager.getSkillBean(skillId,nil);
        if (skillBean == nil) then
            return
        end
        if (skillBean.f_TriggerType == SkillActionTypeEnum.ACTIVE or
                skillBean.f_TriggerType == SkillActionTypeEnum.TRIGGER) then
            if (skillBean.f_Cd >= 30000) then--//策划说加个保险, 超过30秒的技能,不清CD
                return
            end
            local delay = entry.originalDelay
            if (delay <= 0 or entry.delay <= 0) then
                return
            end
            local cdReduce = math.floor(delay * Utils.toRatio(buffEffectValue[1]))--//应该减多少cd
            entry.delay = entry.delay - cdReduce
            if (entry.delay < 0) then
                entry.delay = 0
            end
        end
    end
    for skillId, entry in pairs( entries) do--//给正在冷却的技能, 减正在执行的CD
        loop(skillId,entry)
    end
    --CD 缩减时间, 需要记录下来
    local oldCD = buff.attributes.attributes[FighterAttributeEnum.CD:getId()] or 0
    oldCD = oldCD + buffEffectValue[1];
    if (oldCD >= buffEffectValue[2]) then
    oldCD = 0+buffEffectValue[2];
    end
    buff.attributes.attributes[FighterAttributeEnum.CD:getId()] = oldCD

    local logCd = oldCD;
    SkillRoleMgr.savePathFile( "[" .. fight.frame .. "][EFFECT]Fighter " .. buff.target.fighterId .. " Buff"
    .. buff.modelId .. " 触发减少主动技能的CD, 总共减少 " .. logCd +" %%");
    BuffEffect430005100.action(self,fight, buff, ...);
    return IBuffEffect.SUCCESS_ATTRI_HAS_CHANGE;
end
t.New()